CC = gcc
RM = rm -f
TARGET = run

WORKSPACE := $(shell cd .. && pwd)
INCLUDE_BASE_DIR := /root/opensources/outputs
LINK_BASE_DIR := /root/opensources/outputs

CFLAGS := -Wall -O $(CFLAGS) -std=gnu99
CFLAGS += -I$(INCLUDE_BASE_DIR)/libconfig/include -L$(LINK_BASE_DIR)/libconfig/lib
LINK_LIBS = -lconfig


OBJS = main.o


ALL: $(TARGET)
	@echo $(WORKSPACE)
	@echo "Compile all"
	./$(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) -static $^ -o $@ $(LINK_LIBS)

%.o : %.c
	@echo $(WORKSPACE)
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	$(RM) $(OBJS) $(TARGET)

